﻿using System;

namespace MvcSimplyCleverPart3
{
    public class TypeUtilities
    {
        public static bool InheritsFrom(Type type, Type baseClass)
        {
            if (baseClass == null)
            {
                return false;
            }

            if (type.BaseType == baseClass)
            {
                return true;
            }

            return InheritsFrom(type.BaseType, baseClass);
        }
    }
}